using C3.XNA;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using RpgXna.Model.SpriteBase;

namespace RpgXna.Model.Entities
{
    public class House : CollidableSprite, IEnvironment
    {
        private readonly string _resName;

        public House(int id, int x, int y, string resName, float rotation = 0.0f, float scale = 1.0f)
        {
            _resName = resName;
            Id = id;
            Position = new Vector2(x, y);
            Rotation = MathHelper.ToRadians(rotation);
            Direction = Vector2.Zero;
            Speed = Vector2.Zero;
            Scale = scale;

        }

        #region IEnvironment Members

        public int Id { get; set; }

        public virtual void Draw(SpriteBatch sb)
        {
            sb.Draw(Texture, Position, null, Color.White, Rotation, Origin, Scale, SpriteEffects.None, 0);
            sb.DrawRectangle(Box, Color.Red, 2);
        }

        public virtual void Load(ContentManager cm)
        {
            LoadTexture(cm.Load<Texture2D>(_resName));
        }

        public void Update()
        {
        }
        #endregion IEnvironment Members
    }
}